// The Vue build version to load with the `import` command
// (runtime-only or standalone) has been set in webpack.base.conf with an alias.
import Vue from 'vue'
import App from './App'
import router from './router'
import axios from 'axios'
import ElementUI from 'element-ui'
import 'element-ui/lib/theme-chalk/index.css'
import VueUeditorWrap from 'vue-ueditor-wrap'
import '@/icons'

import cookie from 'js-cookie'

// import '../static/UEditor/ueditor.all.min.js'
// import '../static/UEditor/ueditor.config.js'
// import '../static/UEditor/ueditor.parse.min.js'
import VueQuillEditor from 'vue-quill-editor'

//引入markdown编辑器
import mavonEditor from 'mavon-editor'
import 'mavon-editor/dist/css/index.css'
Vue.use(mavonEditor)

import 'quill/dist/quill.core.css'
import 'quill/dist/quill.snow.css'
import 'quill/dist/quill.bubble.css'

//Vue.use(VueQuillEditor)

Vue.config.productionTip = false

Vue.use(ElementUI)

Vue.prototype.$http = axios

Vue.component('vue-ueditor-wrap', VueUeditorWrap)

axios.interceptors.request.use(
  config =>{
    if(cookie.get('token')){
      config.headers['token']=cookie.get('token')
    }
    return config
  },
  err =>{
    return Promise.reject(err)
  }
)

/* eslint-disable no-new */
new Vue({
  el: '#app',
  router,
  components: { App },
  template: '<App/>'
})
